package com.rxh.trade;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class TradeFactory {
    @Autowired
    private ApplicationContext applicationContext;

    public BaseMethod getTrade(String type) throws ClassNotFoundException, IllegalAccessException, InstantiationException {

        return (BaseMethod) applicationContext.getBean(type);

    }
}
